//
//  CCMineController.m
//  ccZone
//
//  Created by 陈小娟 on 2017/12/13.
//  Copyright © 2017年 CC. All rights reserved.
//

#import "CCMineController.h"
#import "CCHomeController.h"
#import "CCNavigationController.h"
#import "CCLoginNetWorkTool.h"
#import "CCJinJieController.h"
@interface CCMineController ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,strong)CCTableView *hTable;
@end

@implementation CCMineController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor greenColor];
    self.title = @"我的";
    
    _hTable = [[CCTableView alloc]initWithFrame:CGRectZero];

    _hTable.tableFooterView =[[UIView alloc]initWithFrame:CGRectZero];
    _hTable.dataSource = self;
    _hTable.delegate = self;
    [self.contentView addSubview:_hTable];
    [_hTable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.kwNavBar.mas_bottom);
        make.left.right.equalTo(@0);
        make.bottom.equalTo(@(-49));
    }];
}

-(void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    CCHomeController *vc = [[CCHomeController alloc]init];
    //    [self.navigationController pushViewController:vc animated:YES];
    
    CCNavigationController *nav = [[CCNavigationController alloc]initWithRootViewController:vc];
    nav.navigationBar.hidden = YES;
    [self presentViewController:nav animated:YES completion:nil];
    
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}

-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    //父类默认Cell
    BaseCell *cell = [tableView dequeueReusableCellWithIdentifier:BaseCellID];
    cell.textLabel.text = @"ios进阶版基础";
    return cell;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    CCJinJieController *vc = [[CCJinJieController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
